home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / nihcl-30.lha / nihcl-3.0 / test / rectangle.c < prev    next >
C/C++ Source or Header  |  1990-05-19  |  1KB  |  52 lines

  1. /* Test class Rectangle
  2.  
  3.     THIS SOFTWARE FITS THE DESCRIPTION IN THE U.S. COPYRIGHT ACT OF A
  4.     "UNITED STATES GOVERNMENT WORK".  IT WAS WRITTEN AS A PART OF THE
  5.     AUTHOR'S OFFICIAL DUTIES AS A GOVERNMENT EMPLOYEE.  THIS MEANS IT
  6.     CANNOT BE COPYRIGHTED.  THIS SOFTWARE IS FREELY AVAILABLE TO THE
  7.     PUBLIC FOR USE WITHOUT A COPYRIGHT NOTICE, AND THERE ARE NO
  8.     RESTRICTIONS ON ITS USE, NOW OR SUBSEQUENTLY.
  9.  
  10. Author:
  11.     K. E. Gorlen
  12.     Bg. 12A, Rm. 2033
  13.     Computer Systems Laboratory
  14.     Division of Computer Research and Technology
  15.     National Institutes of Health
  16.     Bethesda, Maryland 20892
  17.     Phone: (301) 496-1111
  18.     uucp: uunet!nih-csl!kgorlen
  19.     Internet:kgorlen@alw.nih.gov
  20.  
  21. Function:
  22.     
  23. Modification History:
  24.     
  25. $Log:    rectangle.c,v $
  26.  * Revision 3.0  90/05/20  00:29:49  kgorlen
  27.  * Release for 1st edition.
  28.  * 
  29. */
  30. static char rcsid[] = "$Header: /afs/alw.nih.gov/unix/sun4_40c/usr/local/src/nihcl-3.0/share/test/RCS/rectangle.c,v 3.0 90/05/20 00:29:49 kgorlen Rel $";
  31.  
  32. #include "Point.h"
  33. #include "Rectangle.h"
  34. #include "OrderedCltn.h"
  35.  
  36. main()
  37. {
  38.     cout << "\nTest class Rectangle" << endl;
  39.     Rectangle a(0,0,10,10);
  40.     Rectangle b(Point(1,2),Point(11,3));
  41.     Rectangle c;
  42.     cout << "a = " << a << endl;
  43.     cout << "b = " << b << endl;
  44.     cout << "a == b: " << (a==b) << endl;
  45.     c = a;
  46.     cout << "a isEqual c: " << a.isEqual(c) << endl;
  47.     cout << "a contains b: " << a.contains(b) << endl;
  48.     cout << "a intersects b: " << a.intersects(b) << endl;
  49.     cout << "a||b = " << (a||b) << endl;
  50.     cout << "a&&b = " << (a&&b) << endl;
  51. }
  52.